/*------------------------------
 *hfile:      Vge_PrivManager.h             
 *Created Date:  8/9/2001             
 *Developer:  Stephen.Yao              
 *Studio:	 Zhuq Studio			  
 *------------------------------
 */
#ifndef CCGISPRIVMANAGER__H__INTERFACE
#define CCGISPRIVMANAGER__H__INTERFACE
#include "Vge_MStruct.h"
#include "Vge_ccgisDataBase.h"

namespace ccgis{

class AFX_EXT_CLASS CcgisPrivManager
{
public:
	enum PRIVILEDGE
	{
		privSELECT = 0,//enable other user can select the table;
		privINSERT,//enable other user can insert a record into the table;
		privDELETE,//enable other user can delete a record from the table;
		privUPDATE,//enable other user can update a record    in the table;
		privALTER, //enable other user can alter the table;
		privINDEX, //enable other user can user index of the user;
		privREFERENCES,
		privALL
	};
	//---------------------------------------------------------------------------//
	STATUS prvGrantBasicPriv( char UserName[MAX_NAME] );
	//---------------------------------------------------------------------------//
	STATUS prvGrantTablePriv( char UserName[MAX_NAME],char TableName[MAX_NAME],PRIVILEDGE priv = privSELECT );
	//---------------------------------------------------------------------------//
	STATUS prvGrantTablePriv( char UserName[MAX_NAME],int RegNum,int tabFlag,PRIVILEDGE priv = privSELECT );
	//---------------------------------------------------------------------------//
	STATUS prvGrantRegionPriv( char UserName[MAX_NAME],int RegNum,PRIVILEDGE priv = privSELECT );
	//---------------------------------------------------------------------------//
	STATUS prvRevokeRegionPriv( char UserName[MAX_NAME],int RegNum,PRIVILEDGE priv );
	//---------------------------------------------------------------------------//
	STATUS prvRevokeTablePriv( char UserName[MAX_NAME],char TableName[MAX_NAME],PRIVILEDGE priv );
	//---------------------------------------------------------------------------//
	STATUS prvRevokeTablePriv( char UserName[MAX_NAME],int RegNum,int tabFlag,PRIVILEDGE priv );
	//---------------------------------------------------------------------------//
	STATUS prvRevokeAllPrivs( char UserName[MAX_NAME],char ManagerName[MAX_NAME] );
	//---------------------------------------------------------------------------//
	STATUS prvRevokeBasicPriv( char UserName[MAX_NAME] );
	//---------------------------------------------------------------------------//
	STATUS prvGetUserPriviledg( char UserName[MAX_NAME],char ManagerName[MAX_NAME],CcgisPrivMade *&privs,int &len );
	//---------------------------------------------------------------------------//
};

}

#endif
